home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / amiexpress / source / doors / filecheck / filecheck.c next >
Encoding:
C/C++ Source or Header  |  1992-09-19  |  1.0 KB  |  63 lines

  1. #include <exec/exec.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4.  
  5. #include "work:romconf/doorheader.h"
  6.  
  7.  
  8. #define NOCHECK 1
  9. #define GOODFILE 0
  10. #define BADFILE -1
  11. #define INTERNALCHECK 2
  12. char temp[100];
  13. char FileName[100];
  14. #define sm sendmessage
  15. #define gu getuserstring
  16.  
  17. void end(void);
  18. void LastCommand(void);
  19. int mynode;
  20. main(int argc,char *argv[])
  21. {
  22.    register int i;
  23.    if(argc!=2)
  24.    {
  25.      printf("FileCheck version 1.0 demo, by ByteMaster\n");
  26.      printf("/X 2.30+ SYS.CMD\n");
  27.      printf("\n");
  28.      exit(0);
  29.    }
  30.  
  31.    Register(argv[1][0]-'0');
  32.    mynode=argv[1][0]-'0';
  33.    gu(temp,BB_MAINLINE);
  34.    
  35.    i=0;
  36.    while(temp[i]!='\0' && temp[i]!=' ') i++;
  37.    sm("",1);
  38.    sprintf(FileName,"FILECHECK v1.0: Checking %s",FilePart(&temp[i+1]));
  39.    sm(FileName,1);
  40.  
  41.    if(mynode!=5)
  42.    {
  43.    sm("Releasing File for Internal BBS FileCheck routines",1);
  44.  
  45.    PutInfo(INTERNALCHECK,DT_GOODFILE);
  46.    }
  47.    else
  48.    {
  49.      PutInfo(GOODFILE,DT_GOODFILE);
  50.    }
  51.    ShutDown();
  52.    end();
  53. }
  54.  
  55. void LastCommand(void)
  56. {
  57.   sm("",1);
  58. }
  59.  
  60. void end(void)
  61. {
  62.   exit(0);
  63. }